package mop.model.task;

import java.util.List;

import mop.model.resource.Resource;
import mop.model.task.state.State;
import mop.model.user.User;

/**
 * Memento class for a Task
 */
public class TaskMemento {
    
	/**
	 * Constructor with current attributes of a task
	 * @param id			The id
	 * @param user			The user
	 * @param dependencies	The dependencies
	 * @param parents		The parents
	 * @param status		The status
	 * @param schedule		The schedule
	 * @param resources		The resouces
	 * 
	 * @post id is set to given value
	 * 	|this.id == id
	 * @post user is set to given user
	 * 	|this.user == user
	 * @post dependencies are set to given dependencies
	 * 	|this.dependencies == dependencies
	 * @post parents are set to given parents
	 * 	|this.parents == parents
	 * @post schedule is set to a memento of given schedule
	 * 	|this.schedule == schedul.saveMemento()
	 * @post resources are set to given resources
	 * 	|this.resources == resources
	 */
	public TaskMemento(String id,User user,List<Task> dependencies,List<Task> parents, State status, Schedule schedule, List<Resource> resources)
	{
		this.id = id;
		this.user = user;
		this.dependencies = dependencies;
		this.parents = parents;
		this.schedule = schedule.saveMemento();
		this.status = status;
		this.resources = resources;
	}
	
	/**
	 * Id inspector
	 * @return id
	 */
	public String getId() {
		return id;
	}
	
	/**
	 * User inspector
	 * @return user
	 */
	public User getUser() {
		return user;
	}
	
	/**
	 * Dependencies inspector
	 * @return dependencies
	 */
	public List<Task> getDependencies() {
		return dependencies;
	}
	
	/**
	 * Parents inspector
	 * @return parents
	 */
	public List<Task> getParents() {
		return parents;
	}
	
	/**
	 * Status inspector
	 * @return status
	 */
	public State getStatus() {
		return status;
	}
	
	/**
	 * Schedule inspector
	 * @return schedule
	 */
	public ScheduleMemento getSchedule() {
		return schedule;
	}
	
	/**
	 * Resources inspector
	 * @return resources
	 */
	public List<Resource> getResources() {
		return resources;
	}

	/**
	 * Attributes of a task
	 */
	private String id;
	private User user;
	private List<Task> dependencies;
	private List<Task> parents;
	private State status;
	private ScheduleMemento schedule;
	private List<Resource> resources;
}